/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package android.app;

import android.service.reasons.ServicioReasons;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.entidades.Usuario;
import android.os.IBinder;

/**
 *
 * @author payo
 */
public class BootUpReceiver extends BroadcastReceiver
{
    private ServicioReasons servicio;
    
    @Override
    public void onReceive(Context context, Intent intent) {
            ContextoAndroid.context = context;
            Usuario.isUser();
            Intent i = new Intent(context, ServicioReasons.class);  
            i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
            context.startService(i);
    }
    private ServiceConnection connection = new ServiceConnection()
    {
        @Override
        public void onServiceConnected(ComponentName className,IBinder binder)
        {
            servicio = ((ServicioReasons.MyBinder)binder).getService();
        }
        
        @Override
        public void onServiceDisconnected(ComponentName className)
        {
            servicio = null;
        }
    };

    /*
    private void doBindService() {
        bindService(new Intent(this,ServicioSVTEC.class), connection, Context.BIND_AUTO_CREATE);
    }*/

}